<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='毕业生'}}
{{assign var="app" value='Listing'}}
{{assign var="act" value=''}}
<title>{{$title}} - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}chosen/chosen.html"}}

</head>
<body>

	{{include file="include/sidebar.html"}}
	
	<div class="body_right">
	<div id="content">
	
	<div class="search">
	  <ul class="bread">
		<li>◆ {{$title}}管理</li>
	  <ul>
	</div>
			
		<!--内容 S-->
		<form action="index.php?app={{$app}}&act=save" name="form1" class="form ajaxSubmit" method="post">
		<input type="hidden" name="id" value="{{$result.id}}">
		<input type="hidden" name="item" value="{{$item}}"/>
		<table class="table table-bordered modify">
		  <tbody>
			<tr>
			  <td>姓名：</td>
			  <td>
				<input name="username" type="text" value="{{$result.username}}" />
			  	<span class="red">*</span>
			  </td>
			</tr>
			<tr>
				<td>推荐：</td>
				<td>
			  		{{html_radios name=sex options=array('男','女') checked=$result.hot|default:0}}
				</td>
			</tr>
			<tr>
			  <td>学号：</td>
			  <td>
				<input name="number" type="text" value="{{$result.number}}" />
			  	<span class="red">*</span>
			  </td>
			</tr>
			<tr>
			  <td>专业：</td>
			  <td>
			  	<select name="college" id="college" class="chosen" style="min-width:120px;">
			  		{{if $children==''}}
			  		<option value="">--专业--</option>
			  		{{/if}}
					{{foreach from=$first_children item=college key=key}}
						<option value="{{$key}}" name="college" {{if $key == $result.college}} selected = "selected" {{/if}}>{{$college.title}}</option>
					{{/foreach}}
			  	</select>
			  	<span class="red">*</span>
			  </td>
			</tr>
			<tr>
			  <td>班级：</td>
			  <td>
			  	<select name="major" id="major" class="chosen" style="min-width:120px;">
					{{if $children==''}}
			  		<option value="">--班级--</option>
					{{else}}
					{{foreach from=$children item=major key=key}}
						<option value="{{$key}}" name="major" {{if $key == $result.major}} selected = "selected" {{/if}}>{{$major.title}}</option>
					{{/foreach}}
					{{/if}}
			  	</select>
			  	<span class="red">*</span>
			  </td>
			</tr>
			<tr>
			  <td>毕业时间：</td>
			  <td>
					<input type="text" name="grad_date" class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="{{$result.grad_date}}">
					<span class="red">*</span>
			  </td>
			</tr>
		  </tbody>
		 </table>
		<div class="bottom_button">
			<button type="submit" class="btn btn-info"><i class="icon-ok icon-white"></i>确认</button>
		</div>
		</form>
		<!--内容 E-->
		
</div>
</div>

</body>
<script type="text/javascript">
	$('#college').change(function(){
		 var id = $(this).val();
		 $.post('{{"index.php?app=Listing&act=collegeid2major"|URL}}',{college:id},function(result){
		        if(result.statusCode=='300'){
		        	$('#major').html(result.message);
		        	$(".chosen").trigger("chosen:updated");
		        }else if(result.statusCode=='200'){
		        	$('#major').html(result.message);
		        	$(".chosen").trigger("chosen:updated");
		        }
		    },'json');
	})
</script>
</html>